class CreatePlanets < ActiveRecord::Migration
  def self.up
    create_table :planets do |t|
      t.integer :system_id, :null => false, :options =>
    		"CONSTRAINT fk_planet_systems REFERENCES systems(id)"
    	t.integer :planet_type_id, :null => false, :options =>
    	  "CONSTRAINT fk_planet_planet_types REFERENCES planet_types(id)"
      t.string :name
      t.float :mass, :eccentricity, :semi_major_axis, :null => false
      t.float :inclination

      t.timestamps
    end
  end

  def self.down
    drop_table :planets
  end
end
